package com.neuedu.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.neuedu.entity.UmsAdmin;
import com.neuedu.service.UmsAdminService;
import com.neuedu.vo.ResultJson;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * <p>
 * 管理员表 前端控制器
 * </p>
 *
 * @author wangyu
 * @since 2025-09-02
 */
@RestController
@RequestMapping("/umsAdmin")
@Tag(name = "管理员表")
public class UmsAdminController {
    @Resource
    UmsAdminService umsAdminService;
    @GetMapping("/list")
    @Operation(summary = "分页查询")
    @Parameters({
            @Parameter(name = "pageNo", description = "页码"),
            @Parameter(name = "pageSize", description = "页大小")
    })
    ResultJson<IPage<UmsAdmin>> list(Integer pageNo, Integer pageSize) {
        return ResultJson.success(umsAdminService.page(new Page<>(pageNo, pageSize)));
    }
    @PostMapping("/login")
    ResultJson<Map<String, Object>> login(String username, String password) {
        return ResultJson.success(umsAdminService.login(username, password));
    }

}
